package it.virtuscarroccio.com.service.impl;

import it.virtuscarroccio.com.dao.NewsHasTeamDAO;
import it.virtuscarroccio.com.model.NewsHasTeamExample;
import it.virtuscarroccio.com.model.NewsHasTeamKey;
import it.virtuscarroccio.com.service.NewsHasTeamManager;

import java.util.List;

public class NewsHasTeamManagerImpl implements NewsHasTeamManager{

	private NewsHasTeamDAO newsHasTeamDao;

	public void setNewsHasTeamDao(NewsHasTeamDAO newsHasTeamDao) {
		this.newsHasTeamDao = newsHasTeamDao;
	}

	public void insertNewsHasTeam(NewsHasTeamKey newsHasTeamKey) {
		newsHasTeamDao.insert(newsHasTeamKey);
	}

	public void deleteNewsHasTeam(NewsHasTeamKey newsHasTeamKey) {
		newsHasTeamDao.deleteByPrimaryKey(newsHasTeamKey);
	}

	public void deleteNewsHasTeamByNewsId(Integer id) {
		NewsHasTeamExample example = new NewsHasTeamExample();
		example.createCriteria().andNewsidEqualTo(id);
		newsHasTeamDao.deleteByExample(example);
	}
	
	@SuppressWarnings("unchecked")
	public List<NewsHasTeamKey> selectNewsHasTeamByNewsId(Integer id) {
		NewsHasTeamExample example = new NewsHasTeamExample();
		example.createCriteria().andNewsidEqualTo(id);
		return newsHasTeamDao.selectByExample(example);
	}
	
	
	
	
}
